Thread: c[-1]?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    Feb 2009
    Posts
    278
    Yes you can do that, but you are likely to get a seg fault or other unexpected behavior if you do something like that.

    Just because something works SOMETIMES doesn't mean it will work ALL times.

  2. #2
    C / C++
    Join Date
    Jan 2006
    Location
    The Netherlands
    Posts
    312
    The memory you're writing to isn't allocated, so it's undefined.
    Operating Systems:
    - Ubuntu 9.04
    - XP

    Compiler: gcc

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Promblem with code
    By watchdogger in forum C Programming
    Replies: 18
    Last Post: 01-31-2009, 06:36 PM
  2. Replies: 13
    Last Post: 09-24-2008, 06:16 PM
  3. string manipulation problem
    By bazzano in forum C Programming
    Replies: 3
    Last Post: 10-06-2005, 06:13 AM
  4. Bubble sort
    By Lionmane in forum C Programming
    Replies: 5
    Last Post: 07-09-2005, 11:30 AM
  5. Need help to understand this STL code.
    By Hulag in forum C++ Programming
    Replies: 3
    Last Post: 04-26-2005, 01:59 PM